package com.cnap.multiclouldmgmt.model.scale.policy;

import com.cnap.multiclouldmgmt.model.scale.validator.ValidInterface;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public enum ScalingPolicyResourceEnum implements ValidInterface {
    // cpu
    CPU("cpu"),
    // 内存
    MEMORY("memory"),
    ;
    private final String resourceName;

    ScalingPolicyResourceEnum(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceName() {
        return resourceName;
    }

    @Override
    public boolean isValid(String value) {
        ScalingPolicyResourceEnum[] enums = ScalingPolicyResourceEnum.values();
        for (ScalingPolicyResourceEnum scalingParamResourceEnum : enums) {
            if (scalingParamResourceEnum.getResourceName().equals(value)) {
                return true;
            }
        }
        return false;
    }
}
